package system.controller;

import com.jfinal.core.Controller;
import com.jfinal.log.Log;
import core.jfinal.ext.autoroute.ControllerBind;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;

/**
 * Created by Administrator on 2017/3/14.
 */
@ControllerBind(controllerKey = "/school")
public class Test2Controller extends Controller {


    public void testshiro(){
        renderText("testshiro");
    }

    public void logout(){
        Subject currentuser = SecurityUtils.getSubject();
        if(currentuser.isAuthenticated()) {
            Log.getLog(Test2Controller.class).info("用户"+currentuser.getPrincipals().getPrimaryPrincipal()+"退出");
            currentuser.logout();
        }
        renderText("用户退出");
    }





}
